<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path;
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
	<title>收入提取</title>
	<base href="<%=basePath%>/">

	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1" ;/>
	<!-- IE的渲染模式 -->
	<meta name="keywords"
		content="信帧,teleframe,iparking,I停车,爱停车,blackshadowwalker" />
	<meta name="description"
		content="信帧,teleframe,iparking,I停车,爱停车,blackshadowwalker" />
	<meta name="author" content="blackshadowwalker" />
	
	<link href="css/common.css" rel="stylesheet" />
	<link href="bootstrap/3/css/bootstrap.css" rel="stylesheet" />
	
	<script src="scripts/jquery/jquery-1.7.min.js"></script>
	<script src="bootstrap/3/js/bootstrap.min.js"></script>
	<link href="bootstrap/3/css/datepicker.css" rel="stylesheet" />
	<script src="bootstrap/3/js/bootstrap-datepicker.js"></script>
	
	<script src="index/js/index.js" type="text/javascript"></script>
	<script src="scripts/jquery/tableSorter/scripts/JQueryPlugin/TableSort.js?t=f234324" type="text/javascript"></script>
	<script src="plugins/HubSpotMessager/build/js/messenger.js"></script>
	
	<script type="text/javascript">
			var msg = "${msg}";
			if(msg!="")
				alert(msg);
			function del(id){
				if(confirm("确定要结单吗？"))
					location.href="<%= basePath%>/${action}?method=delete&id="+id;
		}
		$(document).ready(function() {
			//tooltips
			$("[data-toggle='popover']").popover({
				animation : true,
				trigger : 'hover', //trigger: 'focus' | 'hover'
				placement : 'top',
				html : true
			});
			$(".popover-dismiss").popover({
				animation : true,
				trigger : 'hover', //trigger: 'focus' | 'hover'
				placement : 'left',
				html : true
			});
		});
		function ResetForm(){
			$("#mainForm input[name='record.parkManager.userName']").val("");
			$("#mainForm input[name='record.parkManager.realName']").val("");
			$("#mainForm input[name='record.accountBalance']").val("");
			$("#mainForm select[name='record.status']").val("");
		}
	</script>

	<style>
		body {
			margin-left: 10px;
			margin-top: 7px;
			width:98%;
			font-size:10px;
		}
		.form-group{
			width:220px;
			margin-right: 10px;
		}
		div.input-group-addon{
			width:21px;
		}
	</style>

</head>
<body>
	<div class="content" type="list">
	<s:if test="#request.query>=0">
			<form id="mainForm" class="form-inline" action="${action }" role="form" method="post">
				<div class="">
					<div class="form-group" style="width:600px;">
						<div class="input-group">
							<div class="input-group-addon">申请人-帐号:</div>
							<input class="form-control" type="text" placeholder="申请人帐号" name="record.parkManager.userName" value="${record.parkManager.userName }" style="width:121px;" />
							
							<div class="input-group-addon">姓名:</div>
							<input class="form-control" type="text" placeholder="姓名" name="record.parkManager.realName" value="${record.parkManager.realName }" style="width:121px;" />
							
							<div class="input-group-addon">银行帐号:</div>
							<input class="form-control" type="text" placeholder="银行帐号" name="record.accountBalance" value="${record.accountBalance }" style="width:121px;" />
						</div>
					</div>
					<div class="form-group" style="width:180px;">
						<div class="input-group">
							<div class="input-group-addon" >
								 状态
							</div>
							<select class="form-control"  style="width:121px;" name="record.status">
								<option value="">-----</option>
								<option value="-1">拒绝处理</option>
								<option value="1">未处理</option>
								<option value="2">处理中</option>
								<option value="3">已汇款</option>
							</select>
							<script>
								$("#mainForm select[name='record.status']").val("${record.status}");
							</script>
						</div>
					</div>
					
					<input style="" class="btn " type="submit" value="查询" /> 
					<input class="btn" type="button" value="重置" onclick="ResetForm()" />
					
				</div>
			</form>
		</s:if>
			<div class="content" type="list">
			<table  id="mytable" class="table  table-hover" style="width:100%;min-width:700px; border-radius: 4px;">
				<tr role="head">
				<th sort="true" class="hidden" sort="true">id</th>
					<th  sort="true" class="hidden">序号</th>
					<th  sort="true" class="hidden">ID</th>
					<th  sort="true">申请人[帐号] 姓名</th>
					<th  sort="true">手机号</th>
					<th  sort="true">提款金额</th>
					<th  sort="true">银行帐号</th>
					<th  sort="true">帐号姓名</th>
					<th  sort="true">申请时间</th>
					<th  sort="true">处理时间</th>
					<th  sort="true">处理人</th>
					<th  sort="true">状态</th>
					<th>操作</th>
				</tr>
				<s:iterator id="l" value="list" status="index">
				 
					<tr title="${comment }" >
						<td class="hidden"><s:property value="#index.index+1" /></td>
						<td class="hidden" ><s:property value="#l.id" /></td>
						<td>[${parkManager.userName}] &nbsp; ${parkManager.realName}</td>
						<td>${parkManager.phone}</td>
						<td>${amount}元</td>
						<td>${accountBalance}</td>
						<td>${realName}</td>
						<td><s:date name="#l.reqTime" format="yyyy-MM-dd hh:mm:ss" /></td>
						<td><s:date name="#l.processTime" format="yyyy-MM-dd hh:mm:ss" /></td>
						<td>${sysUser.userName}</td>
						<td>${statusName}</td>
						<td>
							<s:if test="#request.remitmoney>0 && status==2">
								<a class="btn btn-primary"style="background-color:#CC66FF"
									href="${action}?method=remitmoney&id=${id}" title="汇款完成">
									<span class="glyphicon glyphicon-usd"></span> </a>
							</s:if>
							<s:if test="#request.okhandle>0 && status==1 ">
								<a class="btn btn-success" style="background-color:#0044BB"
									href="${action}?method=okhandle&id=${id}" title="接受处理"> 
									<span class="glyphicon glyphicon-check"></span> </a>
							</s:if> 
							<s:if test="#request.nohandle>0 && status==2 ">
								<a class="btn btn-danger" style="background-color:#FF0000"
									href="${action}?method=nohandle&id=${id}" title="拒绝处理">
									<span class="glyphicon glyphicon-exclamation-sign"></span> </a>
							</s:if> 
						</td>
					</tr>
				</s:iterator>
			</table>
			</div>
			<!-- 分页 -->
		<div name="pannal-pagecontrol">
			<div name="tablebooter" style="font-size: 13px font-family : '宋体'" align="center">
				
					共&nbsp; ${page.totalRow } &nbsp;条记录,
					共&nbsp; ${page.totalPage } &nbsp;页,
					
					&nbsp;&nbsp;
					<a class="submit"  href="${action}?page.currentPage=1&page.pageSize=${page.pageSize}" style="text-decoration:none;">
						<img src="images/page/PaginStart.gif"	border="0" />
					</a>
					&nbsp;&nbsp;
					<s:if test="page.hasPrePage==true">
						<a class="submit" href="${action}?page.currentPage=${page.prePage}&page.pageSize=${page.pageSize}" style="text-decoration:none;" 	>
							<img src="images/page/PaginLeft.gif" border="0" />
						</a>
					</s:if>
					<s:else>
						<img src="images/page/PaginLeftInactive.gif" border="0" title="已是第一页"/>
					</s:else>
					&nbsp;&nbsp;
					第:
					<select name="page.currentPage" onchange="changePage()" >
						 <script>
						 	var totalpage = "${page.totalPage}";
						 	var currentPage = "${page.currentPage}";
							for(var i=1; i<=totalpage; i++)
							{
								if(i==currentPage)
									document.write("<option value='"+i+"' selected >"+i+"</option>");
								else
									document.write("<option value='"+i+"' >"+i+"</option>");
							}
						 </script>
					</select>
					页
					&nbsp;&nbsp;
					<s:if test="page.hasNextPage==true">
						<a class="submit" href="${action}?page.currentPage=${page.nextPage}&page.pageSize=${page.pageSize}"  style="text-decoration:none;">
							<img src="images/page/PaginRight.gif" border="0" />
						</a>
					</s:if>
					<s:else>
						<img src="images/page/PaginRightInactive.gif" border="0" title="已到达最后一页" />
					</s:else>
					&nbsp;&nbsp;
					<a class="submit" href="${action}?page.currentPage=${page.totalPage}&page.pageSize=${page.pageSize}"  style="text-decoration:none;">
						<img src="images/page/PaginEnd.gif" border="0" />
					</a> 
					
					每页显示
					<select name="page.pageSize" onchange="ResetSelect();changePage();" >
						<option value="5" >5</option>				
						<option value="10" >10</option>				
						<option value="15" >15</option>				
						<option value="20" >20</option>				
						<option value="50" >50</option>				
						<option value="100" >100</option>				
						<option value="200" >200</option>				
						<option value="500" >500</option>				
					</select>
					<script>
						$("select[name='page.pageSize']").val("${page.pageSize}");
					</script>
					条记录&nbsp;
	
			</div>
	
			<script>
				function ResetSelect(){
					$("select[name='page.currentPage']").val('1');
				}
				function changePage(){
					var curPage = $("select[name='page.currentPage']").val();
					var pageSize = $("select[name='page.pageSize']").val();
					var url = "${action}?page.currentPage="+curPage+"&page.pageSize="+pageSize;
					$("#mainForm").attr("action", url);
					$("#mainForm").submit();
					
				}
			
				$(document).ready(function(){
					 
				});
			</script>
		</div>	<!-- end of 分页 -->
	</div><!-- end of list -->
	
	
	<script>
		$(document).ready(function(){
				$("#mytable").sorttable({
		            ascImgUrl: "scripts/jquery/tableSorter/images/bullet_arrow_up.png",
		            descImgUrl: "scripts/jquery/tableSorter/images/bullet_arrow_down.png",
		            ascImgSize: "8px",
		            descImgSize: "8px",
		            onSorted: function (cell) {
// 		               alert(cell.index() + " -- " + $.trim(cell.text()));
		            }
		        });
			});
			
	</script>
</body>
</html>
